<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head th:fragment="head(title)">
    <title th:replace="${title}">Title</title>
    <meta charset="UTF-8">
    <mate name="viewport" content="width=device-width, initial-scale=1" />
    <title>博客</title>
    <script src="../static/js/jquery.js" th:src="@{/js/jquery.js}"></script>
<!--    <script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.5.0/dist/semantic.min.js"></script>-->
    <script src="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.js"></script>
    <script src="../static/lib/prism/prism.js" th:src="@{/lib/prism/prism.js}"></script>
    <script src="../static/lib/tocbot/tocbot.min.js" th:src="@{/lib/tocbot/tocbot.min.js}"></script>
    <script src="../static/lib/qrcode/qrcode.min.js" th:src="@{/lib/qrcode/qrcode.min.js}"></script>
    <script src="../static/lib/waypoints/jquery.waypoints.min.js" th:src="@{/lib/waypoints/jquery.waypoints.min.js}"></script>
    <script src="//cdn.jsdelivr.net/npm/jquery.scrollto@2.1.2/jquery.scrollTo.min.js"></script>
<!--    <link href="https://cdn.jsdelivr.net/npm/semantic-ui@2.5.0/dist/semantic.min.css" rel="stylesheet">-->
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/semantic-ui/2.2.4/semantic.min.css">
    <link rel="stylesheet" href="../static/css/typo.css" th:href="@{/css/typo.css}">
    <link rel="stylesheet" href="../static/css/animate.css" th:href="@{/css/animate.css}">
    <link rel="stylesheet" href="../static/lib/prism/prism.css" th:href="@{/lib/prism/prism.css}">
    <link rel="stylesheet" href="../static/lib/tocbot/tocbot.css" th:href="@{/lib/tocbot/tocbot.css}">
    <link rel="stylesheet" href="../static/css/me.css" th:href="@{/css/me.css}">
    <link rel="stylesheet" href="../static/lib/editormd/css/editormd.css" th:href="@{/lib/editormd/css/editormd.css}"/>
    <script src="../static/lib/editormd/editormd.min.js" th:src="@{/lib/editormd/editormd.min.js}"></script>
</head>
<body>

    <!--后台导航-->
    <nav th:fragment="admin_menu(n)" class="ui inverted attached segment m-padded-tb-tiny">
        <div class="ui container">
            <div class="ui inverted mobile stackable menu secondary ">
                <h2 class="ui teal header  item">广软社区</h2>
                <a href="/admin/blogs" class=" m-item item m-mobile-hide" th:classappend="${n==1} ? 'active'"><i class="small home icon"></i>消息</a>
                <a th:if="${session.user.roleId==1}" href="/admin/typeList" class="m-item item m-mobile-hide" th:classappend="${n==2} ? 'active'"><i class="small idea icon"></i>用户</a>
                <a th:if="${session.user.roleId==1}" href="/admin/typeList" class="m-item item m-mobile-hide" th:classappend="${n==2} ? 'active'"><i class="small idea icon"></i>分类</a>
                <a th:if="${session.user.roleId==1}" href="/admin/tagList" class="m-item item m-mobile-hide" th:classappend="${n==3} ? 'active'"><i class="small tags icon"></i>标签</a>
                <a th:if="${session.user.roleId==1}" href="/admin/imageTypeList" class="m-item item m-mobile-hide" th:classappend="${n==4} ? 'active'"><i class="small picture icon"></i>图片分类</a>
                <div class="right menu m-item m-mobile-hide">
                    <div class="ui dropdown item">
                        <div class="text">
                            <a href="/admin/info_show" th:href="@{/admin/info_show}">
                                <img src="https://picsum.photos/seed/picsum/100/100" th:src="@{${session.user.realAvatar}}" alt="" class="ui avatar image">
                                <span th:text="${session.user.username}" style="color: white">陈炯燏</span>
                            </a>
                        </div>
                        <i class="dropdown icon"></i>
                        <div class="menu">
                            <a href="#" th:href="@{/admin/logout}" class="item">注销</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <a href="#" class="ui menu toggle black basic inverted m-top-right button m-mobile-show">
            <i class="sidebar icon" style="width: 0.1em"></i>
        </a>
    </nav>
    <!--二级菜单-->
    <div th:fragment="two_menu(n)" class="ui attached pointing menu">
        <div class="ui container">
            <div class="right menu">
                <a href="/admin/blogInput" class="item teal" th:classappend="${n==1} ? 'active'">发布</a>
                <a href="/admin/blogs" class="item teal" th:classappend="${n==2} ? 'active'">列表</a>
            </div>
        </div>
    </div>



    <!--前台导航-->
    <nav th:fragment="menu(n)" class="ui inverted attached segment m-padded-tb-tiny">
        <div  class="ui container">
            <div class="ui inverted stackable menu secondary ">
                <h2 class="ui teal header  item">广软社区</h2>
                <a href="/" class="m-item  item m-mobile-hide" th:classappend="${n==1} ? 'active'"><i class="small home icon"></i>首页</a>
                <a href="/type" class="m-item item m-mobile-hide" th:classappend="${n==2} ? 'active'"><i class="small idea icon"></i>分类</a>
                <a href="/tags" class="m-item item m-mobile-hide" th:classappend="${n==3} ? 'active'"><i class="small tags icon"></i>标签</a>
                <a href="/archives" class="m-item item m-mobile-hide" th:classappend="${n==4} ? 'active'"><i class="small clone icon"></i>归档</a>
<!--                <a href="/file/pictures" class="m-item item m-mobile-hide" th:classappend="${n==5} ? 'active'"><i class="small picture icon"></i>照片墙</a>-->
<!--                <a href="/infoMe" class="m-item item m-mobile-hide" th:classappend="${n==5} ? 'active'"><i class="small info icon"></i>关于我</a>-->
                <div class="right item">
                    <form name="search" action="#" th:action="@{/search}" method="post" target="_blank">
                        <div  class="m-item ui inverted transparent m-mobile-hide icon input">
                            <input type="text" th:value="${query}" name="query" placeholder="搜索...">
                            <i onclick="document.forms['search'].submit()" class="search link icon"></i>
                        </div>
                    </form>
                </div>
                <div class="right menu m-item m-mobile-hide" >
                    <div class="item" th:if="${session.user != null}">
                        <div class="text" style="display: flex;">
                            <a href="/admin/info_show" th:href="@{/admin/info_show}">
                                <img src="https://picsum.photos/seed/picsum/100/100" th:src="@{${session.user.realAvatar}}" alt="" class="ui avatar image">
                                <span th:text="${session.user.username}" style="color: white">陈炯燏</span>
                                &nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;
                            </a>
                            <a href="#" style="padding: 0px" th:href="@{/admin/logout}" class="item">注销</a>
                        </div>
                    </div>
                    <div class="item" th:if="${session.user == null}">
                        <a href="/admin">
                            <div class="mini ui teal basic button">登 录</div>
                        </a>
                    </div>
                </div>
            </div>
        </div>
        <a href="#" class="ui menu toggle black basic inverted m-top-right button m-mobile-show">
            <i class="sidebar icon" style="width: 0.1em"></i>
        </a>
    </nav>

    <!--底部footer-->
    <footer th:fragment="footer" class="ui inverted vertical segment  m-padded-tb-massive">
        <div class="ui center aligned container ">
            <div class="ui inverted divided stackable grid">
                <div class="three wide column">
                    <div class="ui inverted link list">
                        <div class="item">
                            <img src="../static/images/scanner_picture.jpg" th:src="@{/images/scanner_picture.jpg}" class="ui rounded image" alt="站长二维码" style="width: 120px;">
                        </div>
                    </div>
                </div>
                <div class="three wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced">最新消息</h4>
                    <div class="ui inverted link list">
                        <a href="#" target="_blank" th:each="topblog:${session.topFour}" class="item"
                           th:text="${topblog.title}" th:href="@{/blog/{id}(id=${topblog.id})}">
                            用户故事（User Story）
                        </a>
                    </div>
                </div>
                <div class="three wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced">联系管理员</h4>
                    <div class="ui container inverted link list">
                        <a href="#" class="item" > Email:1718707267@qq.com</a>
                        <a href="#" class="item" > QQ:1718707267</a>
                    </div>
                </div>
                <div class="seven wide column">
                    <h4 class="ui inverted header m-text-thin m-text-spaced ">广软社区</h4>
                    <p class="m-text-thin m-text-spaced m-text-lined m-opacity-mini">
                        广软社区系统是面向广软学校师生的在线交流和信息共享平台。我们致力于打造一个开放、互动、丰富的学术和社交网络空间，为广软学子提供更广阔的交流平台。
                    </p>
                </div>
            </div>
            <div class="ui inverted section divider"></div>
            <p class="m-text-thin m-text-spaced m-opacity-mini">Copyright ©2023 DaiYan Designed by ChenJiongyu </p>
        </div>
    </footer>

    <script>
        $(".menu.toggle").click(function (){
            $(".m-item").toggleClass("m-mobile-hide");
        })
    </script>

</body>
</html>